load("@batfish//skylark:junit.bzl", "junit_tests")
load("@rules_java//java:defs.bzl", "java_library")

package(
    default_testonly = True,
    default_visibility = ["//visibility:public"],
)

java_library(
    name = "testlib",
    srcs = ["TestUtils.java"],
    deps = [
        "//projects/batfish",
        "//projects/batfish-common-protocol:common",
        "//projects/batfish-common-protocol/src/test/java/org/batfish/datamodel:testlib",
        "//projects/batfish-common-protocol/src/test/java/org/batfish/datamodel/matchers",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:junit_junit",
        "@maven//:org_hamcrest_hamcrest",
    ],
)

junit_tests(
    name = "tests",
    srcs = glob([
        "**/*Test.java",
    ]),
    resources = [
        "//projects/batfish/src/test/resources",
        "//projects/batfish/src/test/resources/org/batfish/dataplane/ibdp/bgp-backup-routes",
        "//projects/batfish/src/test/resources/org/batfish/dataplane/ibdp/bgp-best-path-export",
        "//projects/batfish/src/test/resources/org/batfish/dataplane/ibdp/bgp-topology-change",
    ],
    runtime_deps = [
        "@maven//:org_apache_logging_log4j_log4j_core",
        "@maven//:org_apache_logging_log4j_log4j_slf4j_impl",
    ],
    deps = [
        ":testlib",
        "//projects/batfish",
        "//projects/batfish:batfish_testlib",
        "//projects/batfish-common-protocol:common",
        "//projects/batfish-common-protocol/src/test/java/org/batfish/datamodel:testlib",
        "//projects/batfish-common-protocol/src/test/java/org/batfish/datamodel/matchers",
        "//projects/batfish/src/test/java/org/batfish/dataplane/matchers",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_guava_guava",
        "@maven//:com_google_guava_guava_testlib",
        "@maven//:junit_junit",
        "@maven//:org_apache_commons_commons_lang3",
        "@maven//:org_hamcrest_hamcrest",
    ],
)
